<!--
 * @docName: amountConversion.vue
 * @Author: mwl
 * @Date: 2024/3/13
 * @LastEditors: zhongxiong
 * @LastEditTime: 11:30
-->
<template>
  <span>
    <span v-if="typeConver=='yuan'">{{numNew}}</span>
    <span v-if="typeConver=='wan'">{{numNew}}</span>
  </span>
</template>

<script>
import { conversionElement, conversionManyElement } from '@/utils/util'
export default {
  name: 'amountConversion',
  props:{
    typeConver:{type:String, default:'yuan'},
    num:{type:Number || String}
  },
  data() {
    return {
      numNew:0
    }
  },
  watch: {
    num: {
      handler(val) {
        if(val){
          if(this.typeConver == 'yuan'){
            this.numNew = conversionElement(val)
          }else if(this.typeConver == 'wan'){
            this.numNew = conversionManyElement(val)
          }
        }else{
          this.numNew = 0;
        }

      },
      deep: true,
      immediate: true
    },
  },
  created() {
  },
  mounted() {
  },
  methods:{

  }
}
</script>

<style scoped>

</style>
